import sys
sys.path.append("../")
from services.DataService import *
from controller.BaseController import *
import hashlib

class CommonController(BaseController):
    def __init__(self,args):
        super(CommonController,self).__init__()
        self.args = args
        self.services = DataService()

    def run(self):
        if "params" in self.args:
            rs = self.services.getData(self.args["url"],self.args["params"])
        else:
            rs = self.services.getData(self.args["url"], {})
        return self.rs.setOk("获取成功",rs)